{extend name='public/base' /}
{block name='content'}
{include file='public/content_header' /}
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <!-- 表单头部 -->
                <div class="card-header">
                    <div class="btn-group">
                        <a class="btn flat btn-sm btn-default BackButton">
                            <i class="fas fa-arrow-left"></i>
                            返回
                        </a>
                    </div>
                </div>
                <!-- 表单 -->
                <form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
                    <!-- 表单字段区域 -->
                    <div class="card-body">
                        
<div class="form-group row rowText">
    <label for="project_id" class="col-sm-2 col-form-label">项目</label>
    <div class="col-sm-10 col-md-4 formInputDiv">
        <input id="project_id" name="project_id" value="{$data.project.title|default=''}" placeholder="请输入项目" type="text" class="form-control fieldText" readonly>
    </div>
</div>

<div class="form-group row rowText">
    <label for="user_id" class="col-sm-2 col-form-label">公司</label>
    <div class="col-sm-10 col-md-4 formInputDiv">
        <input id="user_id" name="user_id" value="{$data.user.nickname|default=''}" placeholder="请输入公司" type="text" class="form-control fieldText" readonly>
    </div>
</div>
<div class="form-group row rowEditor">
    <label for="content" class="col-sm-2 col-form-label">内容</label>
        <div class="col-sm-10">
            <div id="contentEditor">{$data.project.content|raw|default='<p></p>'}</div>
            <textarea id="content" name="content" style="display: none" readonly>{$data.project.content|raw|default=''}</textarea>
        </div>
    <script>
        var E = E||window.wangEditor;
        if(editor_content!==undefined){
            editor_content.destroy();
        }
        var editor_content = new E('#contentEditor');
        editor_content.config.zIndex=1000;
        editor_content.config.uploadImgServer = editorUploadUrl;
        editor_content.config.uploadFileName = 'file';
       
        editor_content.create();
        editor_content.config.onchange = function (newHtml) {
            $('#content').val(newHtml);
        };
         editor_content.disable();
</script>
</div>
<div class="form-group row">
                            <label class="col-sm-2 col-form-label ">报价</label>
                            <div class="col-sm-10 col-md-10">
                                <table id="settingSetting" class="table table-hover table-bordered datatable"
                                       width="100%">
                                    <thead>
                                    <tr class="input-type">
                                        
                                        <th>名称</th>
                                        <th>产地</th>
                                        <th>规格</th>
                                        <th>单位</th>
                                        <th>数量</th>
                                        <th>最高报价</th>
                                        <th>报价</th>
                                    </tr>
                                    </thead>
                                    <tbody id="dataBody">
                                    {if isset($data)}
                                    {foreach name='data.detail' id='item'}
                                    <tr>
                                        

                                        

                                        <td>
                                            <input class="form-control" placeholder="名称" value="{$item.name|default=''}"
                                                   maxlength="50"   name="config_name[]" readonly>

                                        </td>
                                        <td>
                                            <input class="form-control" placeholder="产地" value="{$item.chandi|default=''}"
                                                   maxlength="50"   name="config_chandi[]" readonly>

                                        </td>
                                        <td>
                                           
                                            <input class="form-control" placeholder="规格" value="{$item.spec|default=''}"
                                                   maxlength="50"   name="config_spec[]" readonly>
                                        </td>
                                        <td>
                                           
                                            <input class="form-control" placeholder="单位" value="{$item.brand|default=''}"
                                                   maxlength="50"   name="config_brand[]" readonly>
                                        </td>
                                        <td>
                                            <input class="form-control" placeholder="数量" value="{$item.num|default=''}"
                                                   maxlength="50"   name="config_num[]" readonly>

                                        </td>
                                        <td>
                                            <input class="form-control" placeholder="最高报价" value="{$item.price|default=''}"
                                                   maxlength="50"   name="config_price[]" readonly>
                                        </td>
                                        <td>
                                            <input class="form-control" placeholder="报价" value="{$item.money|default=''}"
                                                   maxlength="50"   name="config_money[]" readonly>

                                        </td>
                                    </tr>
                                    {/foreach}
                                    {/if}
                                    </tbody>
                                </table>
                            </div>
                        </div>

    <div class="form-group row rowText">
        <label for="all_money" class="col-sm-2 col-form-label">最高总价</label>
        <div class="col-sm-10 col-md-4 formInputDiv">
            <input id="best_all_money" name="best_all_money" value="{$data.best_all_money|default=''}" placeholder="总价" type="text" class="form-control fieldText" readonly>
        </div>
    </div>
<div class="form-group row rowText">
    <label for="all_money" class="col-sm-2 col-form-label">总价</label>
    <div class="col-sm-10 col-md-4 formInputDiv">
        <input id="all_money" name="all_money" value="{$data.all_money|default=''}" placeholder="总价" type="text" class="form-control fieldText" readonly>
    </div>
</div>
<div class="form-group row rowText">
    <label for="status" class="col-sm-2 col-form-label">状态</label>
    <div class="col-sm-10 col-md-4 formInputDiv">
        <input id="status" name="status" value="{$data.status_name|default=''}" placeholder="请输入状态" type="text" class="form-control fieldText" readonly>
    </div>
</div>

                    </div>
                    <!-- 表单底部 -->
                    
                </form>
            </div>
        </div>
    </div>
</section>
<table>
    <tbody id="data-template" style="display: none">
    <tr>
        
        
        <td>
            <input class="form-control" placeholder="名称" name="config_name[]">

        </td>
        <td>
            
            <select name="config_spec[]" class="form-control">
                <option value="text" >
                    文本[text]
                </option>
            </select>
        </td>
        <td>
            <input class="form-control" placeholder="数量" name="config_num[]">

        </td>
        <td>
            <input class="form-control" placeholder="最高报价" name="config_price[]">

        </td>
        <td>
            <input class="form-control" placeholder="报价" name="config_money[]">

        </td>
    </tr>

    </tbody>
</table>


<script>
    $('#dataBody select').select2();
</script>
{/block}